<?php if (!defined('THINK_PATH')) exit();?><!--这是后台首页-->

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>后台管理</title>
<!--引入样式 -->
<link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
   <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
   <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/Js/jquery-2.1.3.js"></script>

<!--引入样JS-->
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
var verifyUrl='<?php echo U("Admin/Login/verify","",'');?>';
</script>



<style type="text/css">
   
ul li{
margin:0px;
padding:0px;
list-style-type:none;
}

.table td th{
	align:center;
	
}
</style>

</script>
</head>
<body>
   <table class="table">
      <tr>
         <th>用户ID</th>
         <th>用户名称</th>
         <th>上次登录时间</th>
         <th>上次登录IP</th>
         <th>锁定状态</th>
         <th>所属角色</th>
         <th>操作</th>
      </tr>
      <?php if(is_array($user)): foreach($user as $key=>$v): ?><tr>
            <td><?php echo ($v["id"]); ?></td>
            <td><?php echo ($v["username"]); ?></td>
            <td><?php echo (date('Y-m-d H:i',$v["logintime"])); ?></td>
            <td><?php echo ($v["loginip"]); ?></td>
            <td>
              <?php if($v['lock']): ?>锁定
              <?php else: ?>已解锁<?php endif; ?>
            </td>
            <td	>
               <?php if($v['username']==C('RBAC_SUPERADMIN')): ?>超级用户
               <?php else: ?>
               <ul>
	               <?php if(is_array($v["role"])): foreach($v["role"] as $key=>$role): ?><li><?php echo ($role["name"]); ?>(<?php echo ($role["remark"]); ?>)</li><?php endforeach; endif; ?>
               </ul><?php endif; ?>     
            </td>
            <td><a href="<?php echo U(GROUP_NAME.'/Rbac/DelUser',array('uid'=>$v['id']));?>">删除</a></td>
         </tr><?php endforeach; endif; ?>
   </table>
</body>
</html>